home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / misc_src / knowhow4 / remember.h < prev    next >
C/C++ Source or Header  |  1995-11-01  |  880b  |  41 lines

  1. /*   REMEMBER.H  Class wich can remember area under rectangle
  2.      and then restore it     */
  3.  
  4. #ifndef __REMEMBER
  5. #define __REMEMBER
  6.  
  7. #include <geom.h>
  8. #include <graphics.h>
  9. #include <alloc.h>
  10.  
  11.  
  12. class Remember     // remembers area under frame or pixels width
  13.     {
  14.     protected:
  15.     void* image1;    // sides of rectangle are stored here
  16.     void* image2;
  17.     void* image3;
  18.     void* image4;
  19.  
  20.     public:
  21.     Remember() { image1 = image2 = image3 = image4 = NULL; }
  22.     ~Remember()
  23.         {
  24.         delete image4;
  25.         delete image3;
  26.         delete image2;
  27.         delete image1;
  28.         }
  29.     void getimage(rect where, int pixels);
  30.     void putimage(rect where, int pixels, int put);
  31.     void rem()
  32.         {
  33.         delete image4;
  34.         delete image3;     // clear
  35.         delete image2;
  36.         delete image1;
  37.         image1 = image2 = image3 = image4 = NULL;
  38.         }
  39.     };
  40.  
  41. #endif __REMEMBER